package org.util;

import java.lang.reflect.Field;

public class SqlGenerate {
    public static String generateSelect(Class<?> clz){
        String sql = "select ";
        if (clz != null){
            String name = clz.getSimpleName();
            Field[] fs = clz.getDeclaredFields();
            for (Field f : fs) {
                sql += f.getName() + ",";
            }
            sql = sql.substring(0, sql.length() - 1);
            sql += " from " + name;
        }
        return sql;
    }
}
